<template>
  <div class="disForm">
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="试验信息" name="first" style="height:550px;">
        <el-form ref="pram" :model="pram" :rules="rules" label-width="100px" @submit.native.prevent>
          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="试验名称" prop="name">
                <el-input v-model="pram.name" maxlength="100" placeholder="试验名称" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="试验类型" prop="testType">
                <el-select v-model="pram.testType" placeholder="试验类型" clearable style="width: 100%">
                  <el-option
                    v-for="(item,index) in categoryData.testTypeList"
                    :key="index"
                    :label="item.name"
                    :value="item.id"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="年度" prop="year">
                <el-input v-model.number="pram.year" :maxlength="4" placeholder="年度" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="型号" prop="modelType">
                <el-input v-model="pram.modelType"  placeholder="型号" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="所属单位" prop="departmentId">
                <el-cascader v-model="pram.departmentId" :disabled="pram.departmentId ===0" :options="parentOptions" :props="categoryProps" style="width:100%" />
                <!-- allTreeList or parentOptions-->
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="试验科目" prop="subject">
                <el-input v-model="pram.subject"  placeholder="试验科目" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="日期" prop="timeRange" class="disDate">
            <el-date-picker v-model="pram.timeRange" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" @change="onchangeTime" />
          </el-form-item>
          <el-form-item label="概述" prop="description">
            <el-input v-model="pram.description" type="textarea"  maxlength="255" :rows="5" placeholder="请输入概述" />
          </el-form-item>
          <el-form-item label="故障日志" prop="errorLog">
            <el-input v-model="pram.errorLog" type="textarea"  maxlength="255" :rows="5" placeholder="请输入故障日志" />
          </el-form-item>
          <!-- <el-form-item label="试验条件" prop="conditions" style="width:100%;">
            <el-input v-model="pram.conditions" type="textarea"  maxlength="255" :rows="3" placeholder="请输入试验条件" style="width:100%;"/>
          </el-form-item>
          <el-form-item label="试验结果" prop="results">
            <el-input v-model="pram.results" type="textarea"  maxlength="255" :rows="3" placeholder="请输入试验结果" />
          </el-form-item>
          <el-form-item label="出现故障" prop="breakdowns">
            <el-input v-model="pram.breakdowns" type="textarea"  maxlength="255" :rows="3" placeholder="请输入出现故障" />
          </el-form-item>
          <el-form-item label="故障分析定位" prop="breakdownsLoc">
            <el-input v-model="pram.breakdownsLoc" type="textarea"  maxlength="255" :rows="3" placeholder="请输入故障分析定位" />
          </el-form-item>
          <el-form-item label="解决方式" prop="solutions">
            <el-input v-model="pram.solutions" type="textarea"  maxlength="255" :rows="3" placeholder="请输入解决方式" />
          </el-form-item>
          <el-form-item label="归零评审日期" prop="reviewTimeRange" class="disDate">
            <el-date-picker v-model="pram.reviewTimeRange" value-format="yyyy-MM-dd" format="yyyy-MM-dd" size="small" type="daterange" placement="bottom-end" placeholder="自定义时间" @change="onchangeReviewTime" />
          </el-form-item>
          <el-form-item label="排故周期" prop="period">
            <el-select v-model="pram.period" placeholder="排故周期" clearable style="width: 100%">
              <el-option
                v-for="(item,index) in categoryData.periodList"
                :key="index"
                :label="item.name"
                :value="item.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="历史遗留问题" prop="remainCases">
            <el-input v-model="pram.remainCases" type="textarea"  maxlength="255" :rows="3" placeholder="请输入历史遗留问题" />
          </el-form-item>
          <el-form-item label="改进意见" prop="advises">
            <el-input v-model="pram.advises" type="textarea"  maxlength="255" :rows="3" placeholder="请输入改进意见" />
          </el-form-item> -->
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="负责人" name="second">
        <el-form ref="pram1" :model="pram" :rules="rules" label-width="100px" v-if="otherInfoVisible" @submit.native.prevent>
          <el-form-item label="负责人" prop="personList" class="distable">
            <el-button icon="el-icon-circle-plus" type="text" @click.native="handlerOpenPerson(0)" class="person-btn" title="添加负责人"/>
            <el-table :data="pram.personList" size="mini" :header-cell-style=" {fontWeight:'bold'}">
              <template slot="empty"><span></span></template>
              <el-table-column label="时间" prop="timeRange" width="130"/>
              <el-table-column label="负责人" prop="personName" width="110"/>
              <el-table-column label="备注" prop="content" min-width="150"/>
              <el-table-column label="操作" width="155">
                <template slot-scope="scope">
                  <el-button type="primary" size="mini" @click="handlerOpenPerson(1,scope.row,scope.$index)" v-hasPermi="['admin:tests:info']">修改</el-button>
                  <el-button type="danger" size="mini" @click="handlerPersonDel(scope.$index,scope.row)" v-hasPermi="['admin:tests:delete']">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-form-item>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="附件" name="third">
        <el-form ref="pram1" :model="pram" :rules="rules" label-width="100px" v-if="confFileVisible" @submit.native.prevent>
          <el-form-item :label="'附件('+pram.fileUrl.length +'/5)'" prop="fileUrl" class="disUpload">
            <div
              v-for="(item,index) in pram.fileUrl"
              :key="index"
              class="pictrue mb10 mr20 gridPic"
              draggable="true"
              @dragstart="handleDragStart($event, item)"
              @dragover.prevent="handleDragOver($event, item)"
              @dragenter="handleDragEnter($event, item)"
              @dragend="handleDragEnd($event, item)"
            >
              <img
                style="object-fit: contain;"
                v-lazy="item ? item : localImg"
                @click="downloadFile(item)"
                v-if="attTypeArr.pic.includes(item.match(/[^.]+$/)[0])"
              />
              <video
                :src="item"
                @click="downloadFile(item)"
                v-if="attTypeArr.video.includes(item.match(/[^.]+$/)[0])"
              ></video>
              <img
                style="object-fit: contain;"
                v-lazy="localPdf"
                @click="downloadFile(item)"
                v-if="attTypeArr.pdf.includes(item.match(/[^.]+$/)[0])"
              />
              <img
                style="object-fit: contain;"
                v-lazy="localWord"
                @click="downloadFile(item)"
                v-if="attTypeArr.word.includes(item.match(/[^.]+$/)[0])"
              />
              <img
                style="object-fit: contain;"
                v-lazy="localExcel"
                @click="downloadFile(item)"
                v-if="attTypeArr.excel.includes(item.match(/[^.]+$/)[0])"
              />
              <img
                style="object-fit: contain;"
                v-lazy="localZip"
                @click="downloadFile(item)"
                v-if="attTypeArr.zip.includes(item.match(/[^.]+$/)[0])"
              />
<!--              <el-image-->
<!--                class="photo-el-image"-->
<!--                :src="item"-->
<!--                :preview-src-list="pram.fileUrl"-->
<!--              />-->
              <i v-if="!isDisabled" class="el-icon-error btndel" @click="handleRemove(index)"/>
            </div>

            <div v-if="pram.fileUrl.length<5 && !isDisabled" class="upLoadPicBox" @click="modalPicTap('2')">
              <div class="upLoad">
                <i class="el-icon-camera cameraIconfont" />
              </div>
            </div>
          </el-form-item>
        </el-form>
      </el-tab-pane>
    </el-tabs>
    <div class="btn-box">
      <el-button type="primary" @click="handlerSubmit('pram')" v-hasPermi="['admin:tests:update','admin:tests:save']">{{ isCreate===0?'确定':'更新' }}</el-button>
      <el-button @click="close">取消</el-button>
    </div>

    <!-- 负责人 -->
    <el-dialog
      :visible.sync="personDialogConfig.visible"
      :title="personDialogConfig.isCreate === 0? '历年负责人':'历年负责人'"
      destroy-on-close
      :close-on-click-modal="false"
      :append-to-body="true"
      width="700px"
    >
      <person
        v-if="personDialogConfig.visible"
        :is-create="personDialogConfig.isCreate"
        :edit-data="personDialogConfig.editData"
        :edit-key="personDialogConfig.editKey"
        :all-person-list="categoryData.personList"
        @hidePersonDialog="hidePersonDialog"
        @assignPersonSaveAndHidePersonDialog="assignPersonSaveAndHidePersonDialog"
        @assignPersonEditAndHidePersonDialog="assignPersonEditAndHidePersonDialog"
      />
    </el-dialog>

  </div>
</template>

<script>
import person from './person'
import * as roleApi from '@/api/role.js'
import * as testsApi from '@/api/tests.js'
import {Debounce} from '@/utils/validate'
export default {
  // name: "edit"
  components: { person },
  props: {
    isCreate: {
      type: Number,
      required: true
    },
    editData: {
      type: Object,
      default: () => {
        return { rules: [] }
      }
    },
    allCategoryData:{
      type: Object
    },
    allTreeList: {
      type: Array
    },
    allModelTypeList: {
      type: Array
    }
  },
  data() {
    const validateYear = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('请填写年度'));
      } else if (!/^\d{4}$/.test(value)) {
        callback(new Error('年度格式不正确!'));
      } else {
        callback();
      }
    };
    return {
      constants:this.$constants,
      isDisabled: this.$route.params.isDisabled==='1'?true:false,
      activeName:"first",
      otherInfoVisible: false,
      confFileVisible:false,

      pram: {
        name: null,
        departmentId: null,
        testType: null,
        year: null,
        modelType: null,
        subject: null,
        timeRange: null,
        startTime:null,
        endTime:null,
        description:null,
        errorLog:null,
        /*conditions: null,
        results: null,
        breakdowns: null,
        breakdownsLoc: null,
        solutions: null,
        reviewTimeRange: null,
        reviewStartTime:null,
        reviewEndTime:null,
        period: null,
        remainCases: null,
        advises: null,*/
        fileUrl:[],

        personList:[],//负责人列表
        personAdd:[],
        personEdit:[],
        personRemove:'',

        id: 0,
      },
      rules: {
        name: [{ required: true, message: '请填试验名称', trigger: ['blur', 'change'] }],
        departmentId: [{ required: true, message: '请选择所属单位', trigger: ['blur', 'change'] }],
        testType: [{ required: true, message: '请选择试验类型', trigger: ['blur', 'change'] }],
        year: [ { required: true, message: '请填正确的年度', validator : validateYear,trigger: ['blur', 'change']} ],
        modelType: [ { required: true, message: '请选择型号', trigger: ['blur', 'change']} ],
        subject: [ { required: true, message: '请选择试验科目', trigger: ['blur', 'change']} ],
        timeRange: [ { required: true, message: '请选择日期', trigger: ['blur', 'change']} ],
        /*conditions: [ { required: true, message: '请填试验条件', trigger: ['blur', 'change']} ],
        results: [ { required: true, message: '请填试验结果', trigger: ['blur', 'change']} ],
        breakdowns: [ { required: true, message: '请填出现故障', trigger: ['blur', 'change']} ],
        breakdownsLoc: [ { required: true, message: '请填故障分析定位', trigger: ['blur', 'change']} ],
        solutions: [ { required: true, message: '请填解决方式', trigger: ['blur', 'change']} ],
        reviewTimeRange: [ { required: true, message: '请选择归零评审日期', trigger: ['blur', 'change']} ],
        period: [ { required: true, message: '请选择排故周期', trigger: ['blur', 'change']} ],
        remainCases: [ { required: true, message: '请填历史遗留问题', trigger: ['blur', 'change']} ],
        advises: [ { required: true, message: '请填改进意见', trigger: ['blur', 'change']} ],*/
        fileUrl: [{ required: true, message: '请上传附件', trigger: ['blur', 'change'] }],
      },
      categoryData:{
        testTypeList:[],
        subjectList:[],
        personList:[],
        periodList:[],
        typeModelList:[],
      },
      parentOptions: [],
      categoryProps: {
        value: 'id',
        label: 'name',
        children: 'child',
        expandTrigger: 'hover',
        checkStrictly: true,
        emitPath: false
      },
      personDialogConfig: {
        visible: false,
        isCreate: 0, // 0=创建，1=编辑
        editData: {},
        editKey: -1,
      },

      attTypeArr:{
        pic:["jpg","jpeg","gif","png","bmp","PNG","JPG"],
        video:["mp4","avi","flv","wmv"],
        pdf:["pdf","PDF"],
        word:["doc","docx","DOC","DOCX"],
        excel:["xls","xlsx","XLS","XLSX"],
        zip:["zip","rar","ZIP","RAR"]
      },
      localImg: "",
      localWord: require("@/assets/imgs/attr_word.png"),
      localPdf: require("@/assets/imgs/attr_pdf.png"),
      localExcel: require("@/assets/imgs/attr_excel.png"),
      localZip: require("@/assets/imgs/attr_zip.png"),
    }
  },
  mounted() {
    this.initEditData()
  },
  methods: {
    close() {
      this.$emit('hideEditDialog')
    },

    handleClick(tab) {
      if (tab.name === 'second') {
        this.otherInfoVisible = true;
      }
      if (tab.name === 'third') {
        this.confFileVisible = true;
      }
    },

    downloadFile(url){
      const a = document.createElement('a');
      a.href = url; // 文件链接
      a.download = url; // 文件名，跨域资源download无效
      a.target = '_blank';
      a.click();
      a.remove();
    },

    modalPicTap(tit) {
      const _this = this
      var length = _this.pram.fileUrl.length
      this.$modalUpload(function(img) {
        let arr = [];
        if(( length + img.length)>5) return this.$message.warning("最多选择5张图片！");
        img.map((item) => {
          //arr.push(item.attDir)
          _this.pram.fileUrl.push(item.attDir)
        });

        //_this.pram.fileUrl = arr
        // console.log(arr);
        //_this.$emit('successCBK', arr)
      }, tit, 'content')
    },
    handleRemove (i) {
      this.pram.fileUrl.splice(i, 1)
    },

    // 移动
    handleDragStart (e, item) {
      if(!this.isDisabled) this.dragging = item;
    },
    handleDragEnd (e, item) {
      if(!this.isDisabled) this.dragging = null
    },
    handleDragOver (e) {
      if(!this.isDisabled) e.dataTransfer.dropEffect = 'move'
    },
    handleDragEnter (e, item) {
      if(!this.isDisabled){
        e.dataTransfer.effectAllowed = 'move'
        if (item === this.dragging) {
          return
        }
        const newItems = [...this.pram.fileUrl]
        const src = newItems.indexOf(this.dragging)
        const dst = newItems.indexOf(item)
        newItems.splice(dst, 0, ...newItems.splice(src, 1))
        this.pram.fileUrl = newItems;
      }
    },

    // 负责人dialog
    handlerOpenPerson(isCreate, editDate, editKey) {
      this.personDialogConfig.editData = editDate
      this.personDialogConfig.isCreate = isCreate
      this.personDialogConfig.visible = true
      this.personDialogConfig.editKey = editKey
    },
    hidePersonDialog() {
      this.personDialogConfig.visible = false
    },
    assignPersonSaveAndHidePersonDialog(data) {
      setTimeout(() => {
        this.pram.personList.push(data);
        this.personDialogConfig.visible = false
      }, 200);
    },
    assignPersonEditAndHidePersonDialog(data,key) {
      setTimeout(() => {
        this.$set(this.pram.personList,key,data) //更新数组中指定下标的元素

        if (this.isCreate === 1 && data.id){
          //原有数据的编辑
          this.pram.personEdit.push(data)
        }
        this.personDialogConfig.visible = false
      }, 200);
    },
    handlerPersonDel(key,row){
      //删除单行简历数据
      const  _xKey = key
      this.pram.personList.splice(_xKey,1);//index 当前元素索引；1：需要删除的元素个数
      //data=data.filter(item=>item.name!='张三');

      if (this.isCreate === 1 && row.id) {
        //编辑时的删除，记录删除ID
        const delId = row.id

        this.pram.personEdit=this.pram.personEdit.filter(item=>item.id!==delId)
        //this.pram.resumeEdit.splice(_xKey,1)//从编辑项中剔除，直接删除
        this.pram.personRemove+=delId+','
      }
    },

    // 具体日期
    onchangeTime (e) {
      this.timeRange = e

      if(e){
        this.pram.startTime = this.timeRange[0]
        this.pram.endTime = this.timeRange[1]
      }
      /*this.pram.dateLimit = e ? this.timeVal.join(',') : ''*/
    },
    onchangeReviewTime (e) {
      this.reviewTimeRange = e

      if(e){
        this.pram.reviewStartTime = this.reviewTimeRange[0]
        this.pram.reviewEndTime = this.reviewTimeRange[1]
      }
      /*this.pram.dateLimit = e ? this.timeVal.join(',') : ''*/
    },

    initEditData() {
      this.categoryData = this.allCategoryData
      this.parentOptions = [...this.allTreeList]
      this.addTreeListLabelForCasCard(this.parentOptions, 'child')

      if (this.isCreate !== 1) return //编辑

      const { name, departmentId, testType, year, modelType, subject, startTime, endTime, /*conditions, results, breakdowns, breakdownsLoc, solutions, reviewStartTime, reviewEndTime, period, remainCases, advises,*/ personList, description, errorLog, fileUrlArr, id } = this.editData //通过list中slot-scope=“scope“，scope.$index就是该行的下标，scope.row就是该行的数据所有消息对象，有了这两个参数就可以实现编辑、删除功能（this.editData就是scope.row传入的对象参数）
      this.pram.name = name
      this.pram.departmentId = departmentId
      this.pram.testType = testType
      this.pram.year = year
      this.pram.modelType = modelType
      this.pram.subject = subject
      this.pram.startTime = startTime
      this.pram.endTime = endTime
      /*this.pram.conditions = conditions
      this.pram.results = results
      this.pram.breakdowns = breakdowns
      this.pram.breakdownsLoc = breakdownsLoc
      this.pram.solutions = solutions
      this.pram.reviewStartTime = reviewStartTime
      this.pram.reviewEndTime = reviewEndTime
      this.pram.period = period
      this.pram.remainCases = remainCases
      this.pram.advises = advises*/
      this.pram.description = description
      this.pram.errorLog = errorLog
      this.pram.fileUrl = fileUrlArr || []
      this.pram.id = id
      this.pram.personList = personList||[]

      this.pram.timeRange = [this.pram.startTime,this.pram.endTime]
      this.pram.reviewTimeRange = [this.pram.reviewStartTime,this.pram.reviewEndTime]

      this.pram.personAdd = []
      this.pram.personRemove = ''
      this.pram.personEdit = []
    },
    addTreeListLabelForCasCard(arr, child) {
      arr.forEach((o,i) => {
        if (o.child && o.child.length) {
          o.disabled = true
          o.child.forEach((j) => {
            //j.disabled = true
          })
        }
      })
    },
    handlerSubmit:Debounce(function(form) {
      this.$refs[form].validate(valid => {
        if (!valid) return
        if (this.isCreate === 0) {
          this.handlerSave()
        } else {
          this.handlerEdit()
        }
      })
    }),
    handlerSave() {
      //console.log(this.pram);return false;
      testsApi.testsAdd(this.pram).then(data => {
        this.$message.success('创建试验成功')
        this.$emit('hideEditDialog')
      })
    },
    handlerEdit() {
      //console.log(this.pram);return false;
      this.pram.personAdd=this.pram.personList.filter(item=>!item.id)
      this.pram.personRemove = this.pram.personRemove.substring(0,this.pram.personRemove.length - 1)

      testsApi.testsAdd(this.pram).then(data => {
        this.$message.success('更新试验成功')
        this.$emit('hideEditDialog')
      })
    },
  }
}
</script>

<style scoped lang="scss">
  .disDate{
    ::v-deep.el-range-editor--small.el-input__inner{
      width:100%;
      height:36px;
    }
  }

  .disForm{
    ::v-deep.el-form{
      height:550px;
      overflow-y: auto;
      overflow-x: hidden;
      margin-top:20px;
      //padding-right:10px;
    }
    ::v-deep.el-form-item--medium .el-form-item__label{
      width:110px!important;
    }
    ::v-deep.el-form-item--medium .el-form-item__content{
      margin-left:110px!important;
    }
    ::v-deep.disUpload.el-form-item--medium .el-form-item__content{
      margin-left:0px!important;
      display:flex;
      flex-flow: wrap;
    }
  }

  .btn-box{
    margin-top:20px;
  }
  .person-btn{
    position:absolute;
    font-size:24px;
    bottom:10px;
    left:-84px;
  }

  .distable{
    height:500px;

    /* 隐藏伪元素 */
    ::v-deep.el-table::before {
      display: none!important;
    }
    /* 重现下自带下边框线 */
    .el-table--border {
      border-bottom: 1px solid #fff!important;
    }

    ::v-deep.el-table{
      height:500px;
      overflow-y: auto;
      border: 1px solid #f5f5fd;
      td div{
        padding-left:15px!important;
      }
    }
    ::v-deep.el-form-item__label{
      text-align: center !important;
      /*border-right:1px solid #ccc !important;*/
      background-color: #f5f5fd !important;
      color:#9a9b9b;
      line-height:500px;
      padding-right:0 !important;
      width:130px!important;
      white-space: pre-line!important;
    }
    ::v-deep.el-form-item__content{
      margin-left:130px!important;
    }
    ::v-deep.el-input--small .el-input__inner,
    ::v-deep.el-input--medium .el-input__inner{
      height:40px;
      line-height:40px;
      border:0;
      font-size:12px;
    }
    ::v-deep.el-date-editor .el-input__inner{
      padding:0 15px 0 30px!important;
    }
    ::v-deep.el-button--text{
      padding:0 15px;
      color:#ccc !important;
    }
    ::v-deep.el-table__empty-block{
      min-height:auto!important;
      width:auto!important;
    }
  }

  .disUpload{
    /*position:absolute;
    z-index: 2;
    top:0px;
    right: 3px;
    background-color: #fff;
    width: 121px;
    height: 165px;
    border-top:1px solid #eff1f7;
    border-left:1px solid #eff1f7;
    border-bottom:1px solid #eff1f7;*/
    display:flex;
    //justify-content: center;
    //align-items: center;

    ::v-deep.upLoadPicBox{
      .upLoad{
        width: 120px!important;
        height: 120px!important;
        //border: 0!important;
        //background:0!important;
      }
      .pictrue{
        position:absolute;
        z-index: 3;
        top:1px;
        right:-70px;
        width: 120px;
        height: 120px;
        border:0;
      }
    }

    .imgDel{
      position: absolute;
      z-index: 4;
      top: 0;
      border: 0;
      width: 20px!important;
      height: 20px!important;
      text-align: center;
      right: -1px;
      padding: 0px!important;
      line-height: 10px!important;
      border-radius: 0!important;
      font-weight:bold;
    }
    .img-box{
      position:absolute;
      z-index: 3;
      top:0;
      width: 120px;
      height: 165px;
      border:0;
    }

    ::v-deep.el-upload{
      width:100%;
    }
    ::v-deep.el-button{
      width:100%;
      border:0!important;
    }
    ::v-deep.el-button:hover{
      background-color: #fff!important;
    }
  }

  .gridPic {
    margin-right: 15px;
    //margin-bottom: 40px;
    margin-top:10px;
    width: 150px;
    height: 110px;
    position: relative;
    cursor: pointer;
    border: 1px dashed #ccc;
    img {
      width: 100%;
      height: 100%;
      display: block;
    }
    video {
      width: 100%;
      height: 100%;
      display: block;
    }
    .num_badge {
      position: absolute;
      bottom: 6px;
      right: 6px;
      display: inline-block;
      min-width: 20px;
      height: 20px;
      border-radius: 10px;
      background: #1890FF;
      font-size: 14px;
      text-align: center;
      color: #fff;
      line-height: 20px;
    }
    .file-name{
      width:100%;
      display:block;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      padding-top:5px;
    }
  }
  .btndel{
    position: absolute;
    z-index: 1;
    width :20px !important;
    height: 20px !important;
    right: -9px;
    top: -3px;
  }
</style>
